<template>
	<view class="list-meal">
		<view class="list clearfix" v-for="(item1, index) in list" :key="index">
			<view @click="getquery(item1)">
				<image class="fl" v-if="item1&&item1.imageUrl" :src="item1.imageUrl" mode="aspectFill" />
				<view class="fl cont">
					<view class="title">
						{{item1.name}}
						<!-- <text>({{item.enterpriseName}})</text> -->
					</view>
					<!-- <text v-if="details" class="price">￥{{item.price}}<text>（比总单价优惠 ¥{{(item.priceOrigin - item.price).toFixed(2)}}）</text></text> -->
					<text class="intro clearfix"><text class="fl">{{item1.description}}</text></text>
				</view>
				<text class="fr">￥<text>{{item1.price}}元</text></text>
			</view>
		</view>
		
		<!-- <view class="list meal-details clearfix" v-for="(item1, index) in list" :key="index+'item'" v-if="details">
			<router-link :to="getquery(item1)">
				<image class="fl" :src="item1.imageUrl" mode="aspectFill" />
				<view class="fl cont">
					<view class="title">
						{{item1.name}}
					</view>
					<text class="intro clearfix"><text class="fl">{{item1.description}}</text></text>
					<text class="price">￥{{item1.price}}<text>（比总单价优惠 ¥{{(item1.priceOrigin - item1.price).toFixed(2)}}）</text></text>
				</view>
				<image class="fr" src="/static/images/r-arrow.png" mode="widthFix"></image>
			</router-link>
		</view> -->
	</view>
</template>

<script>
export default {
	props: {
		details:false,
		list: {
			// 数据列表
			type: Array,
			default() {
				return [];
			}
		}
	},
	methods:{
		getquery(item) {
			uni.navigateTo({
				url: '/pages/details/details-meal?sid=' + item.id,
			})
		}
	}
};
</script>

<style scoped lang="scss">
.list {
	min-height: 160rpx;
	padding: 30rpx 0;
	border-bottom: 1rpx solid #dfdfdf;
}
.list image {
	width: 148rpx;
	height: 161rpx;
	border-radius: 10rpx;
	background-size: cover;
	background-position: center 0;
}
.list .cont {
	width: 376rpx;
	margin-left: 16rpx;
}
.list .cont .title {
	font-size: 32rpx;
	color: #333;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
	line-height: 45rpx;
	/* height: 85rpx; */
	margin-bottom: 11rpx;
}
.list .cont .title text{
	color: #666;
	font-size: 28rpx;
	margin-left: 16rpx;
}
.list .cont .time{
	color: $uni-color1;
	font-size: 26rpx;
	line-height: 37rpx;
	margin-bottom: 2rpx;
}
.list .cont .intro{
	font-size: 24rpx;
	color: #666;
	letter-spacing: 0.6rpx;
}
.list .cont .intro .fl{
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
}
.list .fr{
	margin-top: 115rpx;
	color: #FF3428;
	font-size: 24rpx;
}
.list .fr text{
	font-size: 36rpx;
}
/* 商家详情 */
.meal-details .cont{
	width: 483rpx;
}
.meal-details .cont .price{
	font-size: 32rpx;
	color: #FF3428;
}
.meal-details .cont .price text{
	font-size: 26rpx;
	line-height: 45rpx;
	color: #666;
	padding-left: 10rpx;
}
.meal-details .fr{
	width: 13rpx;
}
</style>
